function getAllFirstType(path) {
    $.post(
        `${path}/api/firstType/select/all`,
        {},
        (firstTypeArray) => {
            let fistTypeList = JSON.parse(firstTypeArray)

            let element = fistTypeList.map(f => {
                return `<option value="${f.id}">${f.name}</option>`
            })

            $("#firstTypes").html(element)
        }
    )
}

function getSecondaryType(path, firstTypeId) {
    $.post(
        `${path}/api/secondaryType/select/${firstTypeId}`,
        {},
        (secondaryTypeStr) => {
            let secondaryTypeList = JSON.parse(secondaryTypeStr)

            let element = secondaryTypeList.map(s => {
                return `<option value="${s.id}">${s.name}</option>`
            })

            $("#secondaryTypeList").html(element)
        }
    )
}